package com.ruibo.modules.quartz.task;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

import java.util.concurrent.TimeUnit;

/**
 * @ClassName TestTask
 * @Description TestTask
 * @Author SunFeng
 * @Date 2020/2/28 15:26
 * @Version 1.0
 */
@Slf4j
@Component
public class TestTask {

    //@Async
    public void run(){
        log.info("执行成功");
    }

    @Async
    public void run1(String str){
        try {
            log.info("执行成功，参数为： {}" , str);
            TimeUnit.SECONDS.sleep(50);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }
}
